# Maintainer: Alexey Pavlov <alexpux@gmail.com>

_realname=Locale-Gettext
pkgname=perl-${_realname}
pkgver=1.07
pkgrel=4
groups=('perl-modules')
pkgdesc="Permits access from Perl to the gettext() family of functions"
arch=('i686' 'x86_64')
license=('GPL' 'PerlArtistic')
url="http://search.cpan.org/dist/${_realname}/"
depends=('gettext' 'perl')
makedepends=('libcrypt-devel')
options=(!emptydirs)
source=(${_realname}-${pkgver}.tar.gz::"https://www.cpan.org/authors/id/P/PV/PVANDRY/gettext-${pkgver}.tar.gz")
sha256sums=('909d47954697e7c04218f972915b787bd1244d75e3bd01620bc167d5bbc49c15')

build() {
  cd "${srcdir}/${_realname}-${pkgver}"

  # install module in vendor directories.
  perl Makefile.PL INSTALLDIRS=vendor
  make
}

check() {
  cd "${srcdir}/${_realname}-${pkgver}"

  LC_MESSAGES=C make test
}

package() {
  cd "${srcdir}/${_realname}-${pkgver}"
  make install DESTDIR="${pkgdir}"

  # fix permissons
  find ${pkgdir}/usr -type f \( -name *.dll -o -name *.exe \) | xargs chmod 0755

  # remove perllocal.pod and .packlist
  find "${pkgdir}" -name perllocal.pod -delete
  find "${pkgdir}" -name .packlist -delete
}
